import { useCookies } from '@vueuse/integrations/useCookies'
const TokenKey = "admin-token"
const cookie = useCookies()


// 获取token
export function getToken(){
    console.dir(cookie)
    console.log("🚀 ~ file: auth.js:10 ~ getToken ~ cookie.get(TokenKey):", cookie.get(TokenKey))
    console.log("🚀 ~ file: auth.js:11 ~ getToken ~ cookie:", cookie)
    return cookie.get(TokenKey)
}

// 设置token
export function setToken(token){
    console.log("🚀 ~ file: auth.js:15 ~ setToken ~ cookie.set(TokenKey,token):", cookie)
    return cookie.set(TokenKey,token)
}

// 清除token
export function removeToken(){
    return cookie.remove(TokenKey)
}